package nape.geom;
import cx.MixList;
import cx.Algorithm;
import nape.geom.VecMath;
import nape.util.FastMath;















class Vec2 {
	
	
	vec_new(public,p);
	
	
	CxGenerateMixList(Vec2)
	
	
	
	
	public        function new   (?x:Float=0, ?y:Float=0) { vec_set(p,x,y); }
	
	public inline function set   (x:Float,     y:Float)   { vec_set(p,x,y); }
	
	public inline function setvec(v:Vec2)                 { vec_set(p,v.p); }
	
	
	
	
	public inline function clone ():Vec2 return new Vec2(px,py)
	
	
	
	
	public inline function dot   (v:Vec2):Float return vec_dot  (p,v.p)
	
	public inline function cross (v:Vec2):Float return vec_cross(p,v.p)
	
	
	
	
	public inline function lsq   ():Float return vec_lsq   (p)
	
	public inline function length():Float return vec_length(p)
	
}